﻿<?php

/**
 * @author Nguyen Xuan Hong
 * @copyright 2010
 */
	require_once('includes/menu.tbl.php');
	require_once('viewinfo.php');

	$branch_id = $_REQUEST["branch"];
	$id = $_REQUEST["id"];
	$get_data = false;
	$first = false;
	if($id > 0)
	{
		$first = true;
	}
	
	$pClsMenu = new clsMenuTable();
	$listmenu = $pClsMenu->listobj($branch_id);
	
	$arr_link = array();
	foreach($listmenu as $pClsMenu)
	{
		if(!$get_data)
		{
			if(!$first)
			{
				$tile = $pClsMenu->value('title');
				$content = $pClsMenu->value('content');
				$attach = $pClsMenu->value('attach');
				$first = true;
				$get_data = true;
			}
			else if($pClsMenu->value('id') == $id)
			{
				$tile = $pClsMenu->value('title');
				$content = $pClsMenu->value('content');
				$attach = $pClsMenu->value('attach');
				$get_data = true;
			}
			else
			{
				$arr_link[$pClsMenu->value('title')] = "?page=menu&branch=".$branch_id."&id=".$pClsMenu->value('id');
			}
		}
		else
		{
			$arr_link[$pClsMenu->value('title')] = "?page=menu&branch=".$branch_id."&id=".$pClsMenu->value('id');
		}
	}
	view_info_with_attach($title, $content, $attach, "Các thực đơn khác", $arr_link );
?>